<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<title>背景图片管理</title>
	<script src="${ctx}/static/js/imagePreview.js" type="text/javascript"></script>
	<script>
		$(document).ready(function() {
			//聚焦第一个输入框
			$("#background_name").focus();
			//为inputForm注册validate函数
			$("#inputBackgroundForm").validate();
			getImgPath('${ctx}/background/getImgPath');
		});
	</script>
</head>

<body>
	<form id="inputBackgroundForm" enctype="multipart/form-data" action="${ctx}/background/${action}" method="post" class="form-horizontal">
		<input type="hidden" name="id" id="id" value="${background.id}"/>
		<fieldset>
			<legend><small>管理背景图片</small></legend>
			<div class="control-group">
				<label for="background_name" class="control-label">背景图片标题:</label>
				<div class="controls">
					<input type="text" id="background_name" name="name" value="${background.name}" class="input-large required" minlength="3"/>
				</div>
			</div>	
			<div class="control-group">
				<label for="background_remark" class="control-label">备注:</label>
				<div class="controls">
					<textarea id="background_remark" name="remark" class="input-large">${background.remark}</textarea>
				</div>
			</div>
			<div class="control-group">
				<label for="background_pic2" class="control-label">高清图:</label>
				<div class="controls">
					<div id="localImag2"><img id="prev_img2" src="" alt="高清图" /></div>
				    <input type='file' id="doc2" name="2" onchange="readLocalImgURL(this,'2');" accept="image/png"/>
				    <input type='hidden' id="rid2" name="2" />
				</div>
			</div>
			<div class="form-actions">
				<input id="submit_btn" class="btn btn-primary" type="submit" value="提交"/>&nbsp;	
				<input id="cancel_btn" class="btn" type="button" value="返回" onclick="history.back()"/>
			</div>
		</fieldset>
	</form>
</body>
</html>